using System;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;

namespace Adoor.Data
{
	/// <summary>
	/// Summary description for DataUtils.
	/// </summary>
	public static class DataUtils
	{
		public static DataTable CreateCaseInsesitiveDataTable()
		{
			DataTable dt = new DataTable();
            dt.CaseSensitive = false;
            DataColumnCollection col = dt.Columns;
            FieldInfo fi = typeof(DataColumnCollection).GetField("columnFromName", BindingFlags.NonPublic | BindingFlags.Instance);
            System.Collections.IDictionary oldValue = fi.GetValue(col) as System.Collections.IDictionary;
            fi.SetValue(col, CollectionsUtil.CreateCaseInsensitiveHashtable(oldValue));
            return dt;
		}
	}
}
